package com.ymatou.sellerproduct.api.service;

import org.json.JSONObject;

import com.ymt.base.YmatouBaseCall;
import com.ymttest.utils.EnvSetup;

public class AddSellerProductCall extends YmatouBaseCall {
	private static String opurl = "api/SellerProduct/AddSellerProduct";

	public AddSellerProductCall() {
		super(EnvSetup.getSystemUrl("sellerproduct"), opurl, "POST", "JSON");
	}

	@Override
	public void addDefHeader() {
		client.addHeader("Accept", "text/xml,text/javascript,text/html,application/json");
		client.addHeader("Content-Type", "application/json; charset=UTF-8");
	}
	/**
	 * 获取Code
	 * 
	 * @return
	 */
	public String getCode() {
		String Code = null;
		try {
			Code = new JSONObject(getReturnData()).getString("Code");
		} catch (Exception e) {
			e.printStackTrace();
		}
		return Code;
	}

	/**
	 * 获取Msg
	 * 
	 * @return
	 */
	public String getMsg() {
		String BCode = null;
		try {
			BCode = new JSONObject(getReturnData()).getString("Msg");
		} catch (Exception e) {
			e.printStackTrace();
		}
		return BCode;
	}
	/**
	 * 获取ProductID
	 * 
	 * @return ProductID
	 */
	public String getProductID() {
		String ProductID = null;
		try {
			ProductID = new JSONObject(getReturnData()).getJSONObject("Data").getString("ProductID");
		} catch (Exception e) {
			e.printStackTrace();
		}
		return ProductID;
	}

}
